<?php

/*

Warn User (warn_user.php)

*/

$page_title = "Warn User";
$rank_check = 5;
include "header.inc.php";

if ($page == "process")
{
	$findWarn = fetch("SELECT id FROM members2 WHERE username = '$warn_user' AND game = '$game'");
	if ($findWarn[id])
	{
		$warn = format($warn,"#000000");
		systemmessage("$game", "",$findWarn[id],$warn);
	}
	header(error("warn_user.php?game=$game","$warn_user has been warned."));
}

print $openHTML;

if (!$page)
{
	print "

<script name='JavaScript'>
<!--
function update_warn( warn ) {
  with ( window.document ) {
    warn_.warn.value = warn;
    warn_.submit();
  }
}
//-->
</script>

<form action='warn_user.php?game=$game&page=process' method='post' name='warn_'>

<script language=\"javascript\">
<!--
var form_obj	= document.warn_;
var warnings		= new Array();
warnings[0]		= \"This is an official warning from the $gameName2 Staff: \\n\\nSpamming is strictly forbidden on $gameName2. Please do not post messages for your site, shops, whatever. Doing this clutters up our message boards and no one wants to see it. This is your only warning.\";
warnings[1]		= \"This is an official warning from the $gameName2 Staff: \\n\\nSwearing on $gameName2 is STRICTLY forbidden. One more offence of this and you will be frozen.\";
warnings[2]		= \"This is an official warning from the $gameName2 Staff: \\n\\nAbusing the users/staff here at $gameName2 is not allowed, please stop this at once. One more offence of this and you will be frozen.\";
warnings[3]		= \"This is an official warning from the $gameName2 Staff: \\n\\nPosting multiple pointless messages only clutters up our forums and makes other users mad at you, please stop. This is a forum, give it a few minutes for someone to reply.\";

function insert_warning(warning_id) {
	form_obj.warn.value = warnings[warning_id];
}
//-->
</script>

Warn: <input type=text name=warn_user value=\"$warn_user\"><br><br>
<a href='javascript:;' onClick='insert_warning(0); return false;'>Spamming</a><br>
<a href='javascript:;' onClick='insert_warning(1); return false;'>Swearing</a><br>
<a href='javascript:;' onClick='insert_warning(2); return false;'>Abusing Users/Staff</a><br>
<a href='javascript:;' onClick='insert_warning(3); return false;'>Pointless Messages</a><br>

<textarea rows=8 cols=60 name='warn'></textarea>
<br><br>
<input type='submit' value='Warn'>
</form>

	";
}

print $closeHTML;
?>